Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove negative runoff #471

Merged
merged 6 commits into from
Jun 26, 2024
Merged

Conversation

billsacks
Copy link
Member

@billsacks billsacks commented Jun 22, 2024

Description of changes

Remove negative runoff before mapping rof -> ocn by setting negative runoff to 0 and downweighting all positive runoff appropriately so that the global runoff sum is the same as before.

Specific notes

Contributors other than yourself, if any: @mvertens

CMEPS Issues Fixed (include github issue #):

Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial) : Yes - changes answers substantially for runoff fields in B compsets (or other configurations with both active land/river and active ocean) (appears not to change answers in most / all other configurations)

Any User Interface Changes (namelist or namelist defaults changes)? New namelist item: remove_negative_runoff (true by default)

Testing performed

Tested in the context of cesm2_3_beta17

Ran a number of tests using compset 1850_CAM60_CLM50%BGC-CROP_CICE_POP2%ECO_MOSART_SGLC_WW3_SESP_BGC%BDRD and res f19_g17.

  • Confirmed that answers change as expected for runoff. Based on output to stdout (with dbug_flag = 21) and doing some visual spot-checks, confirmed that behavior is as expected: negative runoff is set to 0, positive is downweighted evenly globally, runoff sum (when multiplied by area) is maintained as before.
  • Confirmed that, with the remove_negative_runoff flag set to false, answers are bit-for-bit with before

Also ran aux_cmeps test suite on derecho; all tests passed and were bit-for-bit except for tests that also failed in the baseline:

    FAIL ERS_Ld5.T62_g17.CMOM.derecho_gnu RUN time=17

    FAIL ERR_Ld5.f09_t061.B1850MOM.derecho_intel.allactive-defaultio SHAREDLIB_BUILD failed to initialize
    FAIL ERS_Ld5.f19_g17.I2000Clm51Bgc.derecho_intel.clm-default CREATE_NEWCASE
    FAIL ERS_Ld5.ne30pg3_t232.BLT1850_v0c.derecho_intel.allactive-defaultio RUN time=729

    FAIL ERP_Ln9.f09_f09_mg17.F2000climo.derecho_nvhpc.cam-outfrq9s MODEL_BUILD time=388
    FAIL ERS_Ld5.T62_g17.GMOM_JRA.derecho_nvhpc MODEL_BUILD time=559

I think the passing tests were bit-for-bit because they didn't include any B compset tests, and it appears that runoff is non-negative in the tests that use drof.

I also ran one nag test on izumi, which also passed and was bit-for-bit: SMS_D_Ld5_P32.f10_f10_mg37.I2000Clm50BgcCropRtm.izumi_nag.rtm-default (I didn't run the full aux_cmeps test suite on izumi, because I noticed that most of the izumi aux_cmeps tests failed in the baseline).

Avoid modifying fields in place so that the ROF import fields are truly
what came from ROF. So this removal of negative runoff will just appear
in the fields mapped to OCN.
@billsacks
Copy link
Member Author

@jedwards4b I'm assigning you as a reviewer mainly so you can help with the timing of bringing this in, since it will change answers. I expect @mvertens to do the actual code review.

@billsacks
Copy link
Member Author

(To be clear on my last comment: @jedwards4b , I welcome a review from you if you want, but since I have been talking with @mvertens about this, I figured I'd save your time and just get a code review from her.)

@billsacks
Copy link
Member Author

billsacks commented Jun 22, 2024

A few specific questions / comments:

(1) Is it a problem that this will change behavior by default for all configurations? We can change the default of the new namelist flag if needed to avoid these answer changes.

(2) Based on some spot-checks from a one-year run of compset 1850_CAM60_CLM50%BGC-CROP_CICE_POP2%ECO_MOSART_SGLC_WW3_SESP_BGC%BDRD at f19_g17:

  • At first, negative liquid runoff values are large. In the first ROF coupling step, positive runoff needs to be reduced by about 33% to remove negative runoff!
  • After about 10 days, negative liquid runoff is reduced to about 1% of positive runoff globally. Based on a handful of spot-checks, it seems to stay roughly stable at this level throughout the year-long run. (I haven't looked carefully at this, though.)
  • Negative Ice runoff is more variable
  • In the 1-year run, there are no times when negative liquid runoff exceeds positive. There are two coupling time steps when negative ice runoff exceeds positive.
  • (Note that this run was with SGLC, which is not the standard B1850, which has CISM NOEVOLVE over Greenland: I did this to be consistent with some other testing I did, but this may have impacted runoff values, especially at the start of the run.)

@billsacks
Copy link
Member Author

I have run the aux_cmeps test suite on derecho with these changes; tests pass and are bit-for-bit. I think this will only change answers in B compsets (or other configurations with both active land/river and active ocean). I have updated the top-level comment accordingly.

I just updated to the latest CMEPS that includes the new glc runoff fields and ran test SMS_D_Ld5.f19_g17.B1850G.derecho_intel.allactive-cism-test_coupling, which passed though changed answers as expected. I confirmed that all four runoff fields are now processed in the new routine that removes negative runoff (by running with the dbug_flag set to 21 to trigger the output).

Copy link
Collaborator

@mvertens mvertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billsacks - this looks great. Thanks for the careful implementation.

@jedwards4b jedwards4b merged commit c5973fd into ESCOMP:main Jun 26, 2024
1 of 2 checks passed
@billsacks billsacks deleted the remove_negative_runoff branch July 9, 2024 19:55
billsacks added a commit that referenced this pull request Jul 10, 2024
Separate the control of removing negative runoff for lnd vs glc, and set default to false for glc-derived runoff

### Description of changes

This is a follow-up to #471 .

At least for now, we want the default to be to remove negative runoff for lnd-derived runoff, but NOT for glc-derived runoff. This PR implements that change. Note that this changes behavior for the correction of glc-derived runoff, but keeps the behavior the same as before for lnd-derived runoff.

### Specific notes

Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial): **Yes - changes answers substantially for runoff fields in some B compsets (or other configurations with both active land/river and active ocean) - but only for configurations that have glc-derived runoff; this can currently come from configurations with CISM in EVOLVE mode or DGLC (even in NOEVOLVE mode). Note that this change just undoes part of the answer changes that came from #471 .**

Any User Interface Changes (namelist or namelist defaults changes)? Separates the namelist item remove_negative_runoff into two separate options: remove_negative_runoff_lnd and remove_negative_runoff_glc.

### Testing performed
Please describe the tests along with the target model and machine(s) 
If possible, please also added hashes that were used in the testing

Using `cesm2_3_beta17` (with CISM at `756cfa6f0514d89977d2732ad06a4d364da5d418`, mosart at mosart1.1.02, and removing the contents of `cime_config/testmods_dirs/allactive/defaultio/user_nl_mosart`: Ran three versions of `SMS_D_Ld3.f19_g17.B1850G.derecho_intel.allactive-cism-test_coupling`:
- One with default flags
- One with `remove_negative_runoff_glc` set to true
- One with `remove_negative_runoff_lnd` set to false

I checked the behavior in these in runs with dbug_flag set to 21 so I would see diagnostics of what fields were being adjusted, and confirmed that the correct fields were being operated on in all three cases.
pgf added a commit to pgf/CMEPS that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to remove negative runoff by removing it evenly from positive runoff
3 participants